var req;
var params;

function toserver(f) {

   var url = "http://silo.cs.indiana.edu:13795/servlet/CheckNymServlet?";

   var snym = f.username.value;
   var spwd = f.password.value;
   alert(snym);
   alert(spwd);
   params = "nym="+snym+"&pwd="+spwd+"";
   alert(params);
   loadXMLDoc(url);
      // alert(sfriend);
      //  loadXMLDoc2(sfriend);


}

      
 function callback()
        {
                if(req.readyState == 4)
                {
                   if(req.status == 200) {
                                if(req.responseXML != null) {
                                        //get info from server
                                        alert(req.responseText);
                                        
                                }
                        }
                        else
                                { //alert(req.status);
                                }
        }
        else
        { //alert(req.readyState);
        }
        }


  function loadXMLDoc(url_var)
   {
           if(window.XMLHttpRequest)
           {
                try
                   {
                        req = new XMLHttpRequest();
                                //alert ("Creating new XMLHttpRequest");
                  }
               
              catch(e)
                 {
                  req = false;
                 }
            }
       
         else if(window.ActiveXObject)
          {
                try
                  {
                        req = new ActiveXObject("Msxml2.XMLHTTP");
                  }
               
                catch(e)
                  {
                   try
                     {
                       req = new ActiveXObject("Microsoft.XMLHTTP");
                     }
                  catch(e)
                    {
                       req = false;
                    }
          }
        }

         if(req)
           {
             req.open("GET", url_var, true);
             req.onreadystatechange = callback;
             req.send(params);
           }
  }
     




